package com.insurance.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;
import java.util.UUID;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 合作方角色权限表
 * 
 * @date 2021-02-27 15:51:21
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("partner_role_permission")
public class PartnerRolePermissionEntity implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * 主键
	 */
	@TableId
	private String rpId;
	/**
	 * 角色主键
	 */
	private String roleId;
	/**
	 * 权限主键
	 */
	private String permissionId;

	@TableField(exist=false)
	private String rpIdText;

	public String getRpIdText() {
		return this.rpId != null ? String.valueOf(this.rpId) : "";
	}

	public PartnerRolePermissionEntity(String roleId, String permissionId) {
		this.rpId = UUID.randomUUID().toString().replaceAll("-", "");
		this.roleId = roleId;
		this.permissionId = permissionId;
	}

}
